
# 测试数据种子生成器
from faker import Faker

fake = Faker(locale='zh_CN')

# 注册网络种子服务
from faker.providers import internet
fake.add_provider(internet)

# # 随机IPv4地址
# for _ in range(0,50):
#     print(fake.ipv4_private())

# # 产生随机手机号
# print(fake.phone_number())
#
# # 产生随机姓名
# print(fake.name())
# # 产生随机地址
# print(fake.address())
#
# # 随机产生国家名
# print(fake.country())
# # 随机产生国家代码
# print(fake.country_code())

# # 随机产生城市名
# print(fake.city_name())
#
# # 随机产生城市
# print(fake.city())
#
# # 随机产生省份
# print(fake.province())

# 产生随机email
# print(fake.email())

# 产生随机IPV4地址
# print(fake.ipv4())

# 产生长度在最大值与最小值之间的随机字符串
# print(fake.pystr(min_chars=8, max_chars=8))

# 随机产生车牌号
# print(fake.license_plate())

# 随机产生颜色
# print("rgb(%s)" % fake.rgb_color())  # rgb
# print(fake.safe_hex_color())  # 16进制[web安全颜色]
# print(fake.color_name())  # 颜色名字[英文单词]
# print(fake.hex_color()) # 16进制


# # 随机产生公司名
# print(fake.company())
#
# # 随机产生工作岗位
# print(fake.job())
#
# # 随机生成密码
# print(fake.password(length=10, special_chars=True, digits=True, upper_case=True, lower_case=True))
# # 随机生成uuid
# print(fake.uuid4())

# # 随机生成sha1
# print(fake.sha1(raw_output=False))
# # 随机生成md5
# print(fake.md5(raw_output=False))
#
# # 随机生成女性名字
# print(fake.name_female())
# # 男性名字
# print(fake.name_male())
# # 随机生成名字[不分性别]
# print(fake.name())

# 生成基本信息
# print(fake.profile(fields=None, sex=None))
# print(fake.profile(fields={"company","sex","name","address"}, sex=None))
# print(fake.simple_profile(sex=None))

# 随机生成浏览器代理信息 user_agent
# print(fake.user_agent())

# 随机产生时间 月份
# print(fake.month_name())
# 'May'

# 随机产生时间 2006-01-19 04:37:14
# print(fake.date_time_this_century(before_now=True, after_now=False, tzinfo=None))

# 随机产生时间 14:17:38
# print(fake.time_object(end_datetime=None))

# 在指定范围内随机产生时间
# -10d  10天前
# -10y  10年前
# -10m  10月前
# +10y  10年后

# # 从10月前~10月后的范围时间内生成一个随机时间
# print(fake.date_time_between(start_date="-10M", end_date="+10M", tzinfo=None))
# # now 表示当前时间
# print(fake.date_time_between(start_date="now", end_date="now", tzinfo=None))

#生成未来时间
# print(fake.future_date(end_date="+30d", tzinfo=None))

# 生成一个指定时间之前的过去随机时间
# print(fake.date_time(tzinfo=None, end_datetime=None))
# 2002-09-01 18:27:45

# 生成一个指定时间之前的过去随机时间
# print(fake.date(pattern="%Y-%m-%d", end_datetime=None))
# '1998-08-02'

# 基于当前月生成随机时间
# print(fake.date_time_this_month(before_now=True, after_now=False, tzinfo=None))
# 2020-06-08 10:04:58

# 基于10年内生成随机时间
# print(fake.date_time_this_decade(before_now=True, after_now=False, tzinfo=None))
# 2020-06-08 10:04:58

# 月份
# print(fake.month())
# 08

# print(fake.day_of_week())
# 'Monday'

# print(fake.date_object(end_datetime=None))
# 1982-01-17

# 基于10年内生成随机时间
# print(fake.date_this_decade(before_today=True, after_today=False))
# 2020-02-25

fake.date_this_century(before_today=True, after_today=False)
# datetime.date(2000, 6, 1)

fake.date_this_month(before_today=True, after_today=False)
# datetime.date(2018, 6, 13)

fake.past_datetime(start_date="-30d", tzinfo=None)
# datetime.datetime(2018, 6, 25, 7, 41, 34)

fake.date_this_year(before_today=True, after_today=False)
# datetime.date(2018, 2, 24)

fake.date_time_between_dates(datetime_start=None, datetime_end=None, tzinfo=None)
# datetime.datetime(2018, 6, 26, 14, 40, 5)

fake.date_time_ad(tzinfo=None, end_datetime=None)
# datetime.datetime(673, 1, 28, 18, 17, 55)

fake.date_between_dates(date_start=None, date_end=None)
# datetime.date(2018, 6, 26)

fake.future_datetime(end_date="+30d", tzinfo=None)
# datetime.datetime(2018, 7, 4, 10, 53, 6)

fake.past_date(start_date="-30d", tzinfo=None)
# datetime.date(2018, 5, 30)

fake.time(pattern="%H:%M:%S", end_datetime=None)
# '01:32:14'

fake.day_of_month()
# '19'

fake.unix_time(end_datetime=None, start_datetime=None)

fake.date_time_this_year(before_now=True, after_now=False, tzinfo=None)
# datetime.datetime(2018, 5, 24, 11, 25, 25)

fake.date_between(start_date="-30y", end_date="today")
# datetime.date(2003, 1, 11)

fake.year()
# '1993'
